<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>用户注册</title>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
%>
<base href="<%=basePath%>">
<script src="<%=basePath%>plugin/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>plugin/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<link href="<%=basePath%>plugin/jquery-easyui-1.4.3/themes/default/easyui.css" rel="stylesheet" type="text/css"/> 
<link href="<%=basePath%>plugin/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css"/> 
<link href="<%=basePath%>plugin/jquery-easyui-1.4.3/demo/demo.css" rel="stylesheet" type="text/css"/> 
<script src="<%=basePath%>plugin/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath%>plugin/jquery-easyui-1.4.3/extend.js" type="text/javascript" charset="utf-8"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>

	<div id="win" class="easyui-window" style="width: 500px;"
		data-options="title:'用户注册',
		iconCls:'icon-user_add',
	    modal:true,
	    closable:false,
	    resizable:false,
	    collapsible:false,
	    maximizable:false,
	    minimizable:false,
	    shadow:true">
		<div data-options="region:'north'" style="padding:10px;">
			<form id='regist_form' method="post">
				<table style="margin: auto;">
					<tr>
						<td><label for="name">用户名:</label></td>
						<td><input class="easyui-validatebox textbox" type="text"
							name="login_name"
							data-options="required:true,validType:'englishOrNum',missingMessage:'请输入用户名'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">密&nbsp;&nbsp;码:</label></td>
						<td><input id="password" class="easyui-validatebox textbox"
							type="password" name="login_password"
							data-options="required:true,missingMessage:'请输入密码'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>

					<tr>
						<td><label for="name">重复密码:</label></td>
						<td><input class="easyui-validatebox textbox" type="password"
							name="repassword" data-options="required:true"
							validType="equalTo['#password']" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">真实姓名:</label></td>
						<td><input class="easyui-validatebox textbox" type="text"
							name="user_name"
							data-options="required:true,missingMessage:'请输入真实姓名'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">公司名称:</label></td>
						<td><input class="easyui-textbox" name="companyName"
							data-options="multiline:true" style="height: 50px;" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">公司地址:</label></td>
						<td><input class="easyui-textbox" name="companyAddr"
							data-options="multiline:true" style="height: 50px;" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">公司电话:</label></td>
						<td><input class="easyui-textbox" name="companyPhone"
							data-options="validType:'tel'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">手机：</label></td>
						<td><input class="easyui-textbox" name="user_mobile"
							data-options="validType:'mobile'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
				<tr>
					<td><label for="alipayNo">支付宝账号：</label></td>
					<td><input class="easyui-textbox" name="alipayNo"/></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
				</tr>				
					<tr>
						<td><label for="name">QQ号：</label></td>
						<td><input class="easyui-textbox" name="qqNumber"
							data-options="validType:'QQ'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">当前业务：</label></td>
						<td><select class="easyui-combobox" name="transaction" style="width:138px;"data-options="panelHeight:'auto'">
								<option value="FBA换标">FBA换标</option>
								<option value="FBA中转">FBA中转</option>
								<option value="海外仓储">海外仓储</option>
								<option value="FBA退货业务">FBA退货</option>
						</select></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">主要产品：</label></td>
						<td><input class="easyui-textbox" name="product" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">常用email：</label></td>
						<td><input class="easyui-textbox" name="user_email"
							data-options="validType:'email'" /></td>
					</tr>
				</table>
			</form>
		</div>
		<div data-options="region:'center'" style="text-align: center;padding: 10px;">
			<br /> <a id="customer_regis" href="javascript:void(0);"
				class="easyui-linkbutton" data-options="iconCls:'icon-ok'">注册</a>
			&nbsp;&nbsp;
			<a id="customer_back" href="javascript:void(0);"
				class="easyui-linkbutton" data-options="iconCls:'icon-back'">返回</a>
		</div>
	</div> 
		
	<script type="text/javascript">
	$.extend($.fn.validatebox.defaults.rules, {
		/*必须和某个字段相等*/
		equalTo : {
			validator : function(value, param) {
				return $(param[0]).val() == value;
			},
			message : '两次输入不一致'
		}
	});
	
	$("#customer_regis").click(function() {
		$("#regist_form").form('submit', {
			url : "login/regist.do",
			onSubmit : function() {
				var isValid = $(this).form('validate');
				return isValid;
			},

			success : function(data) {
				//$.messager.alert('提示信息', data);
				var data = eval("(" + data + ")");
				$.messager.alert('提示信息', data.msg);
				if (data.success == true) {
					//window.location.href =  sybp() + '/login/welcome';
					window.location.href ='<%=basePath%>login/welcome';
				} else {
					//$("#alertModal").window('open');
					//$("#alert_msg").text(data.msg);
					//a();
				}
			}
		});
	});
	$("#customer_back").click(function(){
		window.location.href ='<%=basePath%>login/welcome';
	});
	</script>
	<style scoped="scoped">
        .textbox{
            height:20px;
            margin:0;
            padding:0 2px;
            box-sizing:content-box;
        }
       body{
		font-family: Cambria, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
		background:url(images/bg.jpg) ;
		background-size:100% 100%;
		}
    </style>
</body>
</html>